﻿@model Data.DBModels.Category

<h2>Edit</h2>

@using (Ajax.BeginForm("EditPopUp", "Category", new AjaxOptions() { HttpMethod = "Post", UpdateTargetId = @Model.Id.IsValid() ? @Model.Id.ToString() : "displayAllCategories" }))
    {
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Category</legend>

        @Html.HiddenFor(model => model.Id)

        @*<div class="editor-label">
            @Html.LabelFor(model => model.CreatedOn)
        </div>
        <div class="editor-field">
            @Html.HiddenFor(model => model.CreatedOn)
            @Html.ValidationMessageFor(model => model.CreatedOn)
        </div>*@

        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Description)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Description)
            @Html.ValidationMessageFor(model => model.Description)
        </div>

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

